﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Web;
using DataAccessLayer;

namespace ServiceLayer.Entity
{
    [DataContract]
    public class RoleW
    {
        int roleID;
        string roleName;

        [DataMember]
        public int RoleID
        {
            get { return roleID; }
            set { roleID = value; }
        }

        [DataMember]
        public string RoleName
        {
            get { return roleName; }
            set { roleName = value; }
        }

        public static RoleW convert(Role role)
        {
            RoleW u = new RoleW();

            u.RoleID = role.RoleID;
            u.RoleName = role.RoleName;

            return u;
        }

        public static List<RoleW> convertList(List<Role> list)
        {
            List<RoleW> listW = new List<RoleW>();

            foreach (Role x in list)
            {
                listW.Add(convert(x));
            }
            return listW;
        }
    }
}